package com.递归;

public class 反转 {
    static class Sulution{

        public void reverse(int n){

              if(n ==1){
                  return;
              }
              n --;
              reverse(n);
            System.out.print(n+" ");
        }
        public String reverString(String string){
            if(string.length()<=1 || string == null){
                return string;
            }

           return reverString( string.substring(1))+string.charAt(0);

          //  System.out.print(string.charAt(0));
        }
        public static String reverse(String originStr) {
            if(originStr == null || originStr.length() <= 1) {
                return originStr;
            }
            return reverse(originStr.substring(1)) + originStr.charAt(0);
        }
    }

    public static void main(String[] args) {
       Sulution sulution = new Sulution();
      sulution.reverse(9+1);
       String s = "abcde";
        System.out.println( sulution.reverString(s));
//

    }
}
